package xin.mashibo.pattern.factorymethod;

import java.util.ArrayList;
import java.util.List;

/**
 * 身份证工厂类
 *
 * @author MaShibo
 * 日期 :  2019/1/22
 */
public class IDCardFactory extends Factory {

    private List<String> owners = new ArrayList<>();

    @Override
    protected Product createProduct(String owner) {
        return new IDCard(owner);
    }

    @Override
    protected void registerProduct(Product product) {
        owners.add(((IDCard) product).getOwner());
    }
}
